// supplyPlatform

const express = require("express");
const router = express.Router();
const { successResponse, errorResponse } = require("../utils/responseHelper");
const { mockHelper } = require("../mock/mockHelper")

//  * @description 概览
router.get('/overview', function (req, res, next) {
  res.json(successResponse(mockHelper(
    {
      'countList|6': [{
        imgName: 'settled_financial_institutions.png',
        title: '@ctitle(5,8)',
        total: '@natural(3000,30000)',
        'unit|1': ['笔', '家', '款', '人次', '个'],
        subtitle: '银行网点@natural(2000,8000)家。非银行网点@natural(2000,8000)家。'
      }]
    }
  )))
});

//  * @description 信贷产品申请量Top 5
router.get('/applicationVolume', function (req, res, next) {
  res.json(successResponse(mockHelper(
    {
      'nameList|5': ['@ctitle(2)'],
      'countList|5': ['@natural(60, 500)']
    }
  )))
});

//  * @description 获取【每日申请及授信量】数据
router.get('/lineChart', function (req, res, next) {
  res.json(successResponse([
    [82, 32, 91, 34, 129, 133, 132],
    [89, 132, 11, 34, 129, 33, 62],
  ]))
});

//  * @description 获取【区域授信量】数据
router.get('/jinYunMap', function (req, res, next) {
  res.json(successResponse([
    { name: '大源镇', value: 20057.34 },
    { name: '大洋镇', value: 15477.48 },
    { name: '东方镇', value: 31686.1 },
    { name: '舒洪镇', value: 6992.6 },
    { name: '东渡镇', value: 44045.49 },
    { name: '新建镇', value: 40689.64 },
    { name: '壶镇镇', value: 37659.78 },
    { name: '仙都街道', value: 45180.97 },
    { name: '缙云经济开发区（新碧街道）', value: 55204.26 },
    { name: '五云街道', value: 21900.9 },
    { name: '七里乡', value: 4918.26 },
    { name: '前路乡', value: 5881.84 },
    { name: '双溪口乡', value: 4178.01 },
    { name: '溶江乡', value: 2227.92 },
    { name: '胡源乡', value: 2180.98 },
    { name: '方溪乡', value: 9172.94 },
    { name: '石笕乡', value: 3368 },
    { name: '三溪乡', value: 806.98 },
    { name: '新碧街道', value: 806.98 },
  ]))
});

//  * @description 获取【实时授信记录】数据
router.get('/creditRecord', function (req, res, next) {
  res.json(successResponse({
    name: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks'],
    data: [5, 20, 36, 10, 10, 20]
  }))
});

//  * @description 获取【机构授信总量Top10】数据
router.get('/totalCredit', function (req, res, next) {
  res.json(successResponse({
    name: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks'],
    data: [5, 20, 36, 10, 10, 20]
  }))
});

//  * @description 获取【单笔授信金额分布】数据
router.get('/pieChart', function (req, res, next) {
  res.json(successResponse({
    name: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks'],
    data: [5, 20, 36, 10, 10, 20]
  }))
});

//  * @description 获取【授信企业行业分布】数据
router.get('/industryDistribution', function (req, res, next) {
  res.json(successResponse({
    name: ['Shirts', 'Cardigans', 'Chiffons', 'Pants', 'Heels', 'Socks'],
    data: [5, 20, 36, 10, 10, 20]
  }))
});

module.exports = router;